home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17314 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.compuserve.com!newsmaster
  2. From: 100435.736@compuserve.com (David A. Mair)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Objects and ASM
  5. Date: Mon, 15 Apr 1996 08:18:53 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4kt0pg$qdt@dub-news-svc-6.compuserve.com>
  8. References: <4kmof6$csu@sol.sun.csd.unb.ca>
  9. NNTP-Posting-Host: hd26-162.compuserve.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. e5ir@jupiter.sun.csd.unb.ca (Paul Vermette [NiD/BiM]) wrote:
  13.  
  14. >I was wondering how you access variables and methods inside of an object 
  15. >if the object was passed as a parameter to an ASM routine. Also I was 
  16. >wondering the same thing with structs..
  17.  
  18. To do this you will have to know the byte by byte layout of the class
  19. or structure, they are essentially the same.  The layout will be
  20. implementation (and possibly compiler switch) dependant.  If your
  21. assembler routine has the purpose of only manipulating member
  22. variables I would try creating a simple class with a few member
  23. variables then setting them to known but different values, for example
  24. create some integer style member variables of various sizes and
  25. initialise them to 1, 2, 3, 4, etc.  Then with a debugger step into
  26. your assembler routine and browse the memory at the address passed.
  27.  
  28. A far better way would be to get the documentation from your compiler
  29. vendor, or compile to assembler if your compiler supports it and look
  30. at the assembly definition of the class.  You could paste that into
  31. your assembler code.
  32.  
  33. Regards
  34. David.
  35.  
  36.